set INSTALLATION_PATH=%1
set CAT_HOME=%2
set TEMP_DIRECTORY=%INSTALLATION_PATH%\work
set COMPNAME=%COMPUTERNAME%
CALL :LoCase COMPNAME
:CONTINUE
set NAME=%CAT_HOME%\webapps\swf-qudex-collections\WEB-INF\classes\%COMPNAME%.config.xml

REM Create a folder in the webapps directory
mkdir %CAT_HOME%\webapps\swf-qudex-collections
xcopy /Y %TEMP_DIRECTORY%\swf-qudex-collections %CAT_HOME%\webapps\swf-qudex-collections /E
copy /Y %CAT_HOME%\webapps\swf-qudex-collections\WEB-INF\classes\jfig.config.xml %NAME%
del /F %CAT_HOME%\webapps\swf-qudex-collections\WEB-INF\classes\jfig.config.xml
GOTO:EOF
:LoCase
:: Subroutine to convert a variable VALUE to all lower case.
:: The argument for this subroutine is the variable NAME.
FOR %%i IN ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i" "J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r" "S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:CONTINUE